package com.joysuch.wwyt.risk.service;

import com.joysuch.wwyt.risk.entity.RiskMeasureType;
import com.baomidou.mybatisplus.extension.service.IService;
import com.joysuch.wwyt.risk.entity.vo.RiskMeasureTypeNode;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author heqifeng
 * @since 2021-09-10
 */
public interface RiskMeasureTypeService extends IService<RiskMeasureType> {


    List<RiskMeasureTypeNode> getAllTopTypes();

    /**
     * 获取所有子类型
     */
    List<RiskMeasureTypeNode> getAllChilds(Long id);

    List<RiskMeasureType> getByParentId(Long parentId);

    int addTopTypes(List<RiskMeasureType> measureTypes);

    int addChildTypes(List<RiskMeasureTypeNode> riskMeasureTypeNodes);

    RiskMeasureTypeNode findAllParentsByChildId(Long id);

    String findNameById(Long id);

    Integer getMaxTypeLevel();

    List<String> getNamesByTypeLevel(Integer typeLevel);

     List<RiskMeasureType> getAll();


    List<RiskMeasureType> getTopTypes();

    /**
     * 获取所有的管控措施类型层级结构
     * @return
     * @param ids
     */
    Map<Long,RiskMeasureTypeNode> getAllTreeMapping(Set<Long> ids);
}
